package com.awanp3.nimbus.system.form;

import com.awanp3.nimbus.common.core.constant.Constants;
import com.awanp3.nimbus.common.core.domain.model.LoginBody;
import com.awanp3.nimbus.system.api.domain.vo.RemoteClientVo;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

/**
 * 邮件登录对象
 *
 * @author 20014170
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class HWorkLoginBody extends LoginBody {

    /**
     * 邮箱
     */
    @NotBlank(message = "{user.username.not.blank}")
    @Length(min = 2, max = 30, message = "{user.username.length.valid}")
    private String username;


    /**
     * 邮箱code
     */
    @NotBlank(message = "{hwork.token.not.blank}")
    @Pattern(regexp = "^" + Constants.JWT_PREFIX + ".*", message = "{hwork.token.start.with}")
    private String token;

}
